<?php

namespace app\order\controller;

use app\common\controller\PCBase;
use app\BaseController;//测试专用
use app\order\logic\OrderReportDataScreenLogic;
use think\facade\Db;
use Throwable;
use app\common\library\Upload;
use app\reporting\logic\ReportVisitLogic;

class OrderReportDataScreen extends PCBase
{


    public function initialize(): void
    {
        parent::initialize();
    }

    /**
     * index
     * @throws Throwable
     */
    public function index()
    {
        $params     = $this->request->post();
        $OrderReportDataScreenLogic = new OrderReportDataScreenLogic();
        $group_id   = $this->getAdminAuthId();
        $adminId = $this->getAdminId();
        $params['admin_group_id'] = $group_id;
        $params['admin_id'] = $adminId;
        return $OrderReportDataScreenLogic->index($params);
    }
    /**
     * 首页统计
     * @throws Throwable
     */
    public function statistics()
    {
        $params     = $this->request->post();
        $OrderReportDataScreenLogic = new OrderReportDataScreenLogic();
        $group_id   = $this->getAdminAuthId();
        $adminId = $this->getAdminId();
        $params['admin_group_id'] = $group_id;
        $params['admin_id'] = $adminId;
        return $OrderReportDataScreenLogic->statistics($params);
    }


    /**
     * @desc   查看当前页面
     * @author luckyXiong
     * @date   2025-04-28
     */
    public function getRoleType(){
        $params                = $this->request->post();
        $adminId               = $this->getAdminId();
        $params['adminId']     = $adminId;
        $res =(new OrderReportDataScreenLogic())->getRoleType($params);
        return  $this->jsonMessage(200, true, '操作成功',$res);
    }




    /**
     * @desc   获取新首页的基础数据
     * @author luckyXiong
     * @date   2025-04-28
     */
    public function new_statistics(){
        $params                = $this->request->post();
        $adminId               = $this->getAdminId();
        $groupId               = $this->getAdminGroupId();
        $params['groupId']     = $groupId;
        $params['adminId']     = $adminId;
        $res =(new OrderReportDataScreenLogic())->new_statistics($params);
        return  $this->jsonMessage(200, true, '操作成功',$res);
    }



    /**
     * @desc   查看当前页面
     * @author luckyXiong
     * @date   2025-04-28
     */
    public function get_page_path_new(){
        $params                = $this->request->post();
        $params['adminId']     = $this->getAdminId();
        return (new ReportVisitLogic())->get_page_path_new($params);
    }


    /**
     * @desc   运营历史投放报告
     * @author luckyXiong
     * @date   2025-04-28
     */
    public function getHistoryPerson(){
        $params                = $this->request->post();
        $params['adminId']     = $this->getAdminId();
        return (new ReportVisitLogic())->getHistoryPerson($params);
    }



    /**
     * @desc   运营广告花费列表
     * @author luckyXiong
     * @date   2025-04-29
     */
    public function getAdsList(){
        $params                = $this->request->post();
        $params['adminId']     = $this->getAdminId();
        return (new ReportVisitLogic())->getAdsList($params);
    }


    /**
     * @desc   导出广告花费列表
     * @author luckyXiong
     * @date   2025-04-29
     */
    public function export(){
        $params                =  $this->request->post();
        $params['adminId']     =  $this->getAdminId();
        $res                   =  (new ReportVisitLogic())->export_ads($params);
        return  $this->jsonMessage(200,true,'操作成功',null);
    }









}
